Skip to content

cli: port to native - #63477

Draft
simonklee wants to merge 2427 commits into
devfrom
oc-rust
Draft

simonklee wants to merge 2427 commits into
devfrom
oc-rust

Conversation

@simonklee

@simonklee simonklee commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

A message jump left the transcript's window following the tail, and so
did the wheel down to the bottom of the jump's slack. Each new message
then moved the window's start, and the rows on screen jumped by the
height of the row that left. TS keeps the window while the view is
away, which a navigation or its slack makes it. The controls now tell
the transcript while they navigate: the window's start is fixed then,
and it follows the tail again only once they stop.

The transcript model's a_new_message_keeps_a_view_a_jump_holds is the
regression.
The TUI left OpenTUI's tab_focus on, so a Tab that nothing bound moved
the focus to the next focusable widget in tree order. In a prompt or a
select dialog that is the route's prompt under the dialog: what was
typed next went into the hidden prompt, and the dialog's own input
stopped taking keys. Core has no such traversal, and the TUI's forms
and dialogs bind Tab where they use it, so the TUI turns it off.

The dialog model's tab_in_a_dialog_keeps_the_focus_there is the
regression.
It replaces the dialog kit tests of Escape and replace: it checks the
close handlers, the modal mode and the restored focus after every step.
The model checks each move's distance and the hint, the restored row
after a session switch, and the tail after a resize, after every step.
A longer hunt failed now and then on a toast of the plugin monitor's
real clock, or on a frame taken before a session's answer reached the
store. The transcript model now waits for its server's answers, both
models stop the monitor's clock, and the transcript model accepts the
follows OpenTUI makes after a program scroll and the unpinned window a
commit leaves, which TS shares.
The models now share the test support's fake server and drop the
checks and commands that never caught anything: reverts, compactions,
new parts, chained dialogs and the TUI's own dialogs. The transcript
model checks each move's exact distance, so it now catches a backfill
that moves the rows. The dialog model checks the buttons a confirm or
an alert runs, and clicks inside a dialog.

They replace the backfill, first-message, jump and inside-click
examples, and the alert and confirm callback examples.
The mounter row counted every view of its route between the navigation
and the settle. A change batch that lands after the route mounts views
it again by contract (the route syncs each batch), and a location
change in a batch also pushes local, so a loaded box saw three or four
views where the row wanted one. The row guards that the mount notice
does not build the route's tree twice, so it now counts the whole views
its input names, which is one per mount.
@simonklee
simonklee force-pushed the oc-rust branch 2 times, most recently from 462f48b to bf94094 Compare November 21, 2026 06:11
When mini attaches to a reply that is already streaming, deltas sent before the list can arrive after it. Fragments::delta dropped any delta found anywhere in the listed text, as TS does, so a list of "a b" followed by " " and "c" showed "a bc".

Deltas carry no sequence number and a listed part no version, so use their order instead: a repeated delta is one of the last the list holds, and a run of them ends where the listed text ends. A run that may still end there is held back, and shown once a delta proves it new. A resize replay checks the deltas that waited for its list against the restored text the same way.

The full TUI's store appends deltas without this check and is unchanged. The deviation is recorded in parity/deviations/M06-mini-covered-deltas.md.
…ressions

The inbox commands of the store model and the transport model found five
defects. Each keeps one short regression where nothing else caught its
revert: a late enqueue for a missing session, a delivery whose enqueue was
lost, a prompt the pending read drops, and the connection's declared error
text. The loop examples the transport model replaced return in opencode-api.
Restore the every-split SSE example, now with a lone surrogate escape and
U+0085 before data, and the connection loop examples in compact form. A
socket that ends without a close frame gets one short test. The tool name
and lone surrogate cases become rows in existing tests; the de.rs tests
those rows cover go, with the F.2-sse oracle only the differential used.
…xisting tests

The TypeScript differential's rows already guard the wide-character fix.
The depth bound keeps a short test beside the parser; the channel file name
and path.join rows join existing tests. The jsonl and cli.json BOM cases
duplicated the storage and service config rows.
The BOM and U+0085 line, the slash command and the heredoc cases become
inputs and rows of existing tests instead of three new tests.
…shes

The generated-diagram properties and their live TS helper move to the hunt notes (prop-render-hunt). The hang and crash fixes keep one row each in a single table: the self-nested groups, the one-row state rail, the far-out Gantt dates and a hundred labeled transitions; each row fails with its fix reverted. The 16-transition and repeated-edge timing tests go: the first is covered by the hundred, the second guards a debug-build slowdown, not a hang. The grapheme width table keeps one row a rule.
Both preview rows fail with the fix reverted; the group row is enough.
It found the stack overflow traceback, whose rows in a_long_error_is_cut_and_escaped stay; the harness moves to the hunt notes (prop-plugin-hunt). The compat layout test loses its wrapper box.
It found the absolute z and Duration schema bounds, whose rows in the_schema_and_serde_agree_at_the_bounds stay; the generator moves to the hunt notes (prop-plugin-hunt).
Tonight's property pass added a prompt model, a select model, a transcript
window model and a dialog focus model, about 1,400 lines, and deleted the
examples the models covered. The models go; their sources are in the
prop-tui and prop-tui-2 hunt directories.

Each fix the models found keeps its shrunk case as an assertion in an
existing end-result test, and each was checked by reverting the fix:

- the paste over a selection: attach::long_pastes_collapse_...;
- a resize ends a jump, a jump in rows that fit, new rows keep a jump's
  view: navigate::message_navigation_aligns_messages_with_the_top;
- Tab in a dialog: click_focus::a_click_inside_a_dialog_...

The examples the models replaced are back as they were at tick 48. The
script-changes and change-counts unit tests go: the tools end-result tests
show the same cases, now with the changes a script cannot make. The
verbosity unit test guarded no change and goes too.
The select fix's shrunk case (a page down at one row, then 40x18) joins the
twelve-row resize example, which comes back with the other dialog examples
the dialog model had replaced, less the escape case a table already has.
The three mention realign tests become one.
…cases

The resize property and the TS differential found five defects. Each fix
now has its shrunk case as a replay.rs example:
- the shell-idle fix and the shell, skill, compaction-error and
  aborted-compaction resize fixes are one replay checked against a new
  client's list;
- a buffered tool start for a listed running call is a case in the
  restored live-tool example;
- a quiet end after a list that showed its part is a case in the
  restored tools-hidden example.

With the differential gone, reverting the code showed that nothing else
guarded a tool printing once or a listed running compaction's tail. So
the three examples that the differential had replaced are back, in a
shorter form. The conflicting-row example is gone, because the hydration
model fails when a conflict is restored.

The generator, the fold model and the M.6 oracle helper are now in the
prop-mini-hunt notes, so the hunt can run again.
Native plugins were off by default behind the `native` feature and will
not be used (O-192); third-party native code, if it comes back, runs in a
supervised helper process. Without them the crash-supervising parent and
the hang watchdog have nothing left to guard: Luau calls stop on Luau's
own CPU interrupt, TypeScript plugins run in the JS host's process, and
the built-ins are first-party. The parent's only remaining case, a crash
of the Luau VM, is an accepted risk.

Gone: the `native` feature of opencode-plugin, opencode-tui and
opencode-cli and everything behind it (the library loader, dlopen of
plugins, the dependency check, macOS quarantine, the library half of
approvals, the conformance harness and its transcripts), plugin-abi's
`c-abi` feature (the repr(C) tables, ENTRY, `plugin!`, the byte shims,
the pinned SDK test, `describe`'s Metadata and the status codes), the
Rust cdylib examples, `plugin dev` and `plugin test`, the parent process
(`contain.rs`), the shared crash record, the watchdog and its hang
notice, the crash list, safe mode, the unsupervised hold, the draft
snapshot and the restart handoff.

The call monitor stays: per-call timing, the slow-plugin reports and the
CPU-time overrun. A library target is still recognised and listed as
skipped, with SKIPPED_NATIVE as the reason. Plugin tests that ran each
plugin twice, linked and through the C ABI loopback, now run once,
linked.
Without the crash-supervising parent, a plugin that crashes or freezes
the client as it starts would stop every run. `--no-plugins` starts the
TUI with no external plugin of any carrier: no Luau VM and no JS host
start, and a project's plugin is not asked about. `/plugins` lists each
target as skipped with SKIPPED_NO_PLUGINS, so the user can see what was
held back and remove it; the built-ins load as always.

The TypeScript CLI has no such flag (D01-no-plugins). The flag is marked
`own` in the command table: the tests that hold the table, the help and
the usage errors to TypeScript's recordings leave it out, the wizard does
not ask about it, and the P-CLI completions cases mask its lines on both
sides. Its name already reads as a negation, so it gets no
`--no-no-plugins`.
The guides, the SDK's README and the deviations described the C ABI, the
crash parent and `plugin dev`; they now describe the linked, Luau and
pipe carriers, say that third-party native code may return as a
supervised helper process, and point a user stuck with a bad plugin to
`--no-plugins`.

P-PTY's P.0b Rust-only scenarios (foreground programs, a long title) ran
the sample library's `pty` commands; a Luau twin in parity/plugins/title
now runs them beside the TS plugin, so the fixture builds no library.
`title` and `title-off`, which compared TS with the native sample, are
gone, as are the P4c crash and hang scenarios. P-CLI builds the client
without `--features native`, which no longer exists.
The Rust drivers of the life, project, manager and views machines in
parity/machines/plugins.json loaded the plugin as a native library, so
they went with the native carrier. Plugin life, project approval and
the manager's keys apply to Luau plugins as well, and no other test
walked them, so the drivers now load parity/plugins/life/init.luau and
other/init.luau, Luau ports of the TypeScript plugins beside them.

The life plugin reads the pending keys, so Luau's Read gains
keymapPending. The loader's walk and build probes become public for
the driver, which reconciles until the loader settles. Every expected
failure the machines list for Rust still holds on Luau.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant